/*********************************************************
 *********************************************************
 ********************                  *******************
 *************                                ************
 *******                  _oo0oo_                  *******
 ***                     o8888888o                     ***
 *                       88" . "88                       *
 *                       (| -_- |)                       *
 *                       0\  =  /0                       *
 *                     ___/`---'\___                     *
 *                   .' \\|     |// '.                   *
 *                  / \\|||  :  |||// \                  *
 *                 / _||||| -:- |||||- \                 *
 *                |   | \\\  -  /// |   |                *
 *                | \_|  ''\---/''  |_/ |                *
 *                \  .-\__  '-'  ___/-. /                *
 *              ___'. .'  /--.--\  `. .'___              *
 *           ."" '<  `.___\_<|>_/___.' >' "".            *
 *          | | :  `- \`.;`\ _ /`;.`/ - ` : | |          *
 *          \  \ `_.   \_ __\ /__ _/   .-` /  /          *
 *      =====`-.____`.___ \_____/___.-`___.-'=====       *
 *                        `=---='                        *
 *      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~      *
 *********__佛祖保佑__永无BUG__验收通过__钞票多多__*********
 *********************************************************/
package org.jbase.jbsc.commons.core.vo;

/**
 * Project: jbsc-commons <br/>
 * File: PagerVo.java <br/>
 * Class: org.jbase.jbsc.commons.core.vo.PagerVo <br/>
 * Description: <描述类的功能>. <br/>
 * Copyright: Copyright (c) 2011 <br/>
 * Company: https://gitee.com/liuzp315 <br/>
 * Makedate: 2020/8/26 下午6:25 <br/>
 *
 * @author popo
 * @version 1.0
 * @since 1.0
 */

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.io.Serializable;
import java.util.Collections;
import java.util.List;

@ApiModel(description = "返回的分页结果")
public class PagerVo<T> implements Serializable {

    @ApiModelProperty("总页数")
    private long pages = 1L; //总页数
    @ApiModelProperty("总记录数")
    private long total = 0L; //总记录数
    @ApiModelProperty("每页记录数")
    private long size = 10L; //每页记录数
    @ApiModelProperty("当前页号")
    private long current = 1L; //当前页号

    @ApiModelProperty("当前页的数据")
    private List<T> records = Collections.emptyList(); //当前页的数据


    public PagerVo() {
        this.pages = 1L; //总页数
        this.total = 0L; //总记录数
        this.size = 10L; //每页记录数
        this.current = 1L; //当前页号
        this.records = Collections.emptyList(); //当前页的数据
    }

    public PagerVo(long current) {
        this.pages = 1L; //总页数
        this.total = 0L; //总记录数
        this.size = 10L; //每页记录数
        this.current = current; //当前页号
        this.records = Collections.emptyList(); //当前页的数据
    }

    public long getPages() {
        return pages;
    }

    public PagerVo<T> setPages(long pages) {
        this.pages = pages;
        return this;
    }

    public long getTotal() {
        return total;
    }

    public PagerVo<T> setTotal(long total) {
        this.total = total;
        return this;
    }

    public long getSize() {
        return size;
    }

    public PagerVo<T> setSize(long size) {
        this.size = size;
        return this;
    }

    public long getCurrent() {
        return current;
    }

    public PagerVo<T> setCurrent(long current) {
        this.current = current;
        return this;
    }

    public List<T> getRecords() {
        return records;
    }

    public PagerVo<T> setRecords(List<T> records) {
        this.records = records;
        return this;
    }

//    @ApiModelProperty("每页记录数，size的别名")
//    public long get_p_size() {
//        return size;
//    }
//
//    @ApiModelProperty("当前页号，current的别名")
//    public long get_p_no() {
//        return current;
//    }
//
//    @ApiModelProperty("总记录数，total的别名")
//    public long get_p_total() {
//        return total;
//    }
}
